package com.lingnan.blog.mapper;

import com.lingnan.blog.entity.Tag;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 标签Mapper
 *
 * @author HeGuanChao
 */
@Mapper
public interface TagMapper {
    /**
     * 查询所有标签
     *
     * @return List<Tags>
     */
    @Select("select * from tag")
    @Results({
            @Result(id = true, column = "id", property = "id"),
    })
    List<Tag> selectByAll();

    /**
     * 根据id查询标签数据
     *
     * @param id
     * @return
     */
    @Select("select * from tag where id = #{id} ")
    @Results({
            @Result(id = true, column = "id", property = "id"),
    })
    Tag selectById(Integer id);
}